UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c2GRpvvC9vtH/fE74lFuu6EcB6lfaWtnyhbQtBVNemQ=' 
WHERE 
  key_id = '98cea6b6b0c0099b8cf4efb1f65b0206fb75bc95beaf8ee32809d221904ba75e' 
  AND (
    token = 'c2GRpvvC9vtH/fE74lFuu6EcB6lfaWtnyhbQtBVNemQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039