UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8JbabBWpvoMiJaFDck6VgwgO+2vHkd8E1YKoTL2q8u8='
WHERE
key_id = '700b2dd8ce8380536aa4e3fc253e20f34a887e97baa7f921b80bcb6267c43db3'
AND (
token = '8JbabBWpvoMiJaFDck6VgwgO+2vHkd8E1YKoTL2q8u8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)