UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ijwlN8t1S8Z3JiKvVYEuNUEX9u3kcHKNFFWmuhnxyiI='
WHERE
key_id = 'df07bd0ae7b5410f24105acc59ada8881bcfc17e19074432c387274f48c0440a'
AND (
token = 'ijwlN8t1S8Z3JiKvVYEuNUEX9u3kcHKNFFWmuhnxyiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)