UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kDAn+Ve8IFGRdzR0ZCqe3/qv0olBfGzrXtjkI+6eXlc=' 
WHERE 
  key_id = '8e11aa59623d9def99a5e3d8684a1ce04f9023570f7b87840da77083693aa5ff' 
  AND (
    token = 'kDAn+Ve8IFGRdzR0ZCqe3/qv0olBfGzrXtjkI+6eXlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028