UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JAS/QXemk82MaRlkM2+A/Ji3Q9o7B++iMb01BEi7sPI=' 
WHERE 
  key_id = '9f0410ae4a4ff3c7066d762eb3e6169281a0886a27d9f889e47be050a9fcf077' 
  AND (
    token = 'JAS/QXemk82MaRlkM2+A/Ji3Q9o7B++iMb01BEi7sPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020