UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RcKXZy7xhZ9Sr+VRpHB2mN+xsZG8LxwKZSdS2vtb8zE=' 
WHERE 
  key_id = '843f8a4a1f1e2f067909d0f1f3539302b7c2c2bb6c5bc767dd25fe4a070d56b9' 
  AND (
    token = 'RcKXZy7xhZ9Sr+VRpHB2mN+xsZG8LxwKZSdS2vtb8zE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047