UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cc+Izl71cWphYu99aHlMiIwJTTyTdZmKQEPBfIJNxLo=' 
WHERE 
  key_id = '7b17cfa4c1b3db90c90c1ff1efc40ea3519e7c23edad4ba776a5f0ce4d8bed94' 
  AND (
    token = 'Cc+Izl71cWphYu99aHlMiIwJTTyTdZmKQEPBfIJNxLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043