UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wFQvn3fAZ/tg5sn7/hULY1uXJhBFFa1z2XMTEV8D0RU='
WHERE
key_id = '7a63dd25ea7ad711a423d3c2a702301baa009069e5a41015e0823ee5d10c15b0'
AND (
token = 'wFQvn3fAZ/tg5sn7/hULY1uXJhBFFa1z2XMTEV8D0RU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)