UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HES5LzU9n7UTk8Jy/Pj9MOhGyUZaXuG57dLu1Yjv4AM='
WHERE
key_id = 'bc527923654c6fe655848acddb8359812e602a725185642cfd41745f12562562'
AND (
token = 'HES5LzU9n7UTk8Jy/Pj9MOhGyUZaXuG57dLu1Yjv4AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)