UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdCLr28HxTxgfV8DQVNhg8Rt+NC2aj8WQ3sxXDGjTWE=' 
WHERE 
  key_id = '0c67f3c161f7e748fa661b7ca5bf7591c1c1f68c82646fa83a4257d9448c9b0e' 
  AND (
    token = 'rdCLr28HxTxgfV8DQVNhg8Rt+NC2aj8WQ3sxXDGjTWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033