UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F7Z2JkmyefTCWsUrWxm2ZdTidCW73p43dD3OfKHW4Kc=' 
WHERE 
  key_id = '21ec5804b5b3d344d945d510996413a224c85fefa8221429cb68b7076eaa9a44' 
  AND (
    token = 'F7Z2JkmyefTCWsUrWxm2ZdTidCW73p43dD3OfKHW4Kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055