UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AnzOZYkt4Us+n96wgtXue2ikZR7a7GWDAc4PBIQvBQ8=' 
WHERE 
  key_id = '78dde21818075baea2d680af3daa1e2b09606f4126f8993f47b7142158882709' 
  AND (
    token = 'AnzOZYkt4Us+n96wgtXue2ikZR7a7GWDAc4PBIQvBQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017