UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZE2zsw3sujMR/1GLFS4w0cUxAoPN5Ywt0UmylaUTvBY='
WHERE
key_id = '220ab7a7fada3820b65506c56b40c11ed81a559854ba5b997d6d3bbfdb03bf30'
AND (
token = 'ZE2zsw3sujMR/1GLFS4w0cUxAoPN5Ywt0UmylaUTvBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)