UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gnVR2TRHgf9urN2LZKioR4G4fP9FjQpP9psAbDnTj5s=' 
WHERE 
  key_id = 'df87d15bbd8c981499fe51c088f6bbac1a90fc6914238a42692ae34c32d38261' 
  AND (
    token = 'gnVR2TRHgf9urN2LZKioR4G4fP9FjQpP9psAbDnTj5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029