UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S6PSX/guzn+Xfg128nazvZ9ma5zNXhmhqWZySoJFH/4='
WHERE
key_id = 'f8b25c3cdc5c2934d256ee5cbe3281257643b218d37b165e6414e12e245ff176'
AND (
token = 'S6PSX/guzn+Xfg128nazvZ9ma5zNXhmhqWZySoJFH/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)