UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nodDRCTGXjvVnUzIckllBdYhmV3JNcR4kgt9bd3OTKc=' 
WHERE 
  key_id = '66fd23569e878381ddf8fd27d7a02b6585396f38487972ce64ba1ec4454e1fd2' 
  AND (
    token = 'nodDRCTGXjvVnUzIckllBdYhmV3JNcR4kgt9bd3OTKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030