UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gse2S+i17tIG6v1ZKsWDF0TD2WwXobd0a5NOeAHRWl8=' 
WHERE 
  key_id = '8f055ab71a81aacdd418583631b37df7c9b6ab7ff5bc669388912600791c342f' 
  AND (
    token = 'Gse2S+i17tIG6v1ZKsWDF0TD2WwXobd0a5NOeAHRWl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025