UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fCgG1gmj16f/ts9xLABez4JhGZ/k2Ftc6qBh04yfltQ='
WHERE
key_id = 'f77459be147cc200e25843f94b044978131c8d087dad9dd5e24e53fd6017c209'
AND (
token = 'fCgG1gmj16f/ts9xLABez4JhGZ/k2Ftc6qBh04yfltQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)