UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4cFDU2NkGOAPI5esE4Z/wxpSQw1MmWbie85fO0Mt6vo=' 
WHERE 
  key_id = '530583e1abad9924ae42adec6ff920d5bd3250bb6e0125d07ec47042bfacf17e' 
  AND (
    token = '4cFDU2NkGOAPI5esE4Z/wxpSQw1MmWbie85fO0Mt6vo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032