UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zkr3Ap5OOvn1XrN9PyKPtKeNaCH9Unuy/0AvlkrjnnA=' 
WHERE 
  key_id = '469ff6c489345c08cd5d8601904a0cecda7fdd1663b5df78a3bdb70c88e2dee9' 
  AND (
    token = 'Zkr3Ap5OOvn1XrN9PyKPtKeNaCH9Unuy/0AvlkrjnnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026