UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4kQStK/fDFnZlx0ESzVfL3A5dAd1y01ENd0cvsXGsSw=' 
WHERE 
  key_id = 'e88eb628512b1ce1c1352a551da1e2c7e17240ead5873c42855f36628308c6e7' 
  AND (
    token = '4kQStK/fDFnZlx0ESzVfL3A5dAd1y01ENd0cvsXGsSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036