UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/+4vjMgQSiKrYg+c1XwkGCeethf4HTd1vjzl/JU6+A=' 
WHERE 
  key_id = '770e4d15191d6a710d56b415f8370c127ca936d24cdf59786ff56d0c1a1fdb23' 
  AND (
    token = '1/+4vjMgQSiKrYg+c1XwkGCeethf4HTd1vjzl/JU6+A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066