UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EmTyhwpeHyMm8KcAoe3MfiwGz3u/marpeaNqsKJvmBc='
WHERE
key_id = '77f70949c3d05dcb66477981e6f7c4aca26e1473b6badfce4b6454541cb33834'
AND (
token = 'EmTyhwpeHyMm8KcAoe3MfiwGz3u/marpeaNqsKJvmBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)