UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DtHRCG1n6EN5mB4zF6gftAl4CD6bijlg1fh7d6rw64E='
WHERE
key_id = '29281e518cd12f986c9f00c3e0f77d763bb8cfc6b36eb41dd3b26ba61b5a06af'
AND (
token = 'DtHRCG1n6EN5mB4zF6gftAl4CD6bijlg1fh7d6rw64E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)