UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+TCy9qNBAIhoe8kSVWnvpX2kzkKZ1DQgHPRbdNFazEY=' 
WHERE 
  key_id = '235e604e200d088afec9a6d94dd11131ac893f10a27a01a7fc52f4906b1761d5' 
  AND (
    token = '+TCy9qNBAIhoe8kSVWnvpX2kzkKZ1DQgHPRbdNFazEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049