UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w6zOARMGzgwAAZ1gqTOu1iqxbFEgoPINB+Ka+y/UuAk=' 
WHERE 
  key_id = '33034ab130d335007bd90e568d85b569fd2e3ed8042ecb734126be46dc7c546e' 
  AND (
    token = 'w6zOARMGzgwAAZ1gqTOu1iqxbFEgoPINB+Ka+y/UuAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033