UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJGGfWjrgHHhfMWj+EWt8yTxAD6cCnUwzkRu1vn3o7U=' 
WHERE 
  key_id = '4d48fe970b56dfcbbbe5dfb3472ec9339e919efd2ac6c1473a898ef9d5e48478' 
  AND (
    token = 'wJGGfWjrgHHhfMWj+EWt8yTxAD6cCnUwzkRu1vn3o7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031