UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qlMF3iMhux2FqlRUZCEfr4Bajsycx8e1kJiAr+2JocU='
WHERE
key_id = '837a0b34bf4ee5b9a49b7da47c1ee70f6e471ccffb927835df845dc7aee4fee7'
AND (
token = 'qlMF3iMhux2FqlRUZCEfr4Bajsycx8e1kJiAr+2JocU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)