UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yXFHTpFLB/PNkh6YLl6XDbTEgX4P/dd98cL78kwJ1+k=' 
WHERE 
  key_id = 'fc1a0c7beb668a66a9ebac4281be51cd96f87fc7dec4548335af4fe8a0793343' 
  AND (
    token = 'yXFHTpFLB/PNkh6YLl6XDbTEgX4P/dd98cL78kwJ1+k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052