UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KEkdyobQDHbs8AOKoK8EUuMh0nOyWz3E+qJtPL9/u9A='
WHERE
key_id = '2ec6b86a4c19430d2606950ae6b076e9faeda3367ea62091687b7e25a5f14239'
AND (
token = 'KEkdyobQDHbs8AOKoK8EUuMh0nOyWz3E+qJtPL9/u9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)