UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Utrgq0x6ye7gDfhctgLOD4xKIhKPIA5OVmAe/aQdBJA=' 
WHERE 
  key_id = 'd21c9f54ac12e1e88ae8b07132b44f997854471e0e9ee69a21d6cde38905ac27' 
  AND (
    token = 'Utrgq0x6ye7gDfhctgLOD4xKIhKPIA5OVmAe/aQdBJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023