UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '96N++Nh6ha3RosQmjaAzoKX4m2y3wLaMUJqqC5XyxpU='
WHERE
key_id = 'ebbcf19d0156628ebb5687085d3c351da6e72e9bba56b2e65a0f58423529fa87'
AND (
token = '96N++Nh6ha3RosQmjaAzoKX4m2y3wLaMUJqqC5XyxpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)