UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Yoj9/hj0CSdJ3paDwllUFfuP/tC+Uu7vzkH58msBtY=' 
WHERE 
  key_id = 'c62352b3d67be5390b5f50aed0b354e40e7cd84eefe71100f916c44c6c35941f' 
  AND (
    token = '2Yoj9/hj0CSdJ3paDwllUFfuP/tC+Uu7vzkH58msBtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032