UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Ui4ffoP2MoXB8MHIon7Vzr8cjiU1H/RJRpGsdhTsL0=' 
WHERE 
  key_id = 'ec0cb02162fb201d3d4b176314b1327c553e596bf12c1f928f90c5a18c94307c' 
  AND (
    token = '5Ui4ffoP2MoXB8MHIon7Vzr8cjiU1H/RJRpGsdhTsL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018