UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gcchZobaM4c1AHKfqwlvdqeGky60DFZg+zIwn2GNvws=' 
WHERE 
  key_id = '412853690ffd65f3af7ead2b41f8a184a374749f0aca08ee5bf2673cde842b97' 
  AND (
    token = 'gcchZobaM4c1AHKfqwlvdqeGky60DFZg+zIwn2GNvws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029