UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uJG74La4Zbq7ZLYvQCSHghEkmkQ4rdhZ+gvAGQ/8gs0=' 
WHERE 
  key_id = '17f1cc538dfe3d75a80659bf98cdb96177b3f0078b8e4394636234d6a8852e55' 
  AND (
    token = 'uJG74La4Zbq7ZLYvQCSHghEkmkQ4rdhZ+gvAGQ/8gs0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031