UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/+TD2H5Z5kYu9zkOv2YPKhS1TygHB2dfA4+7EjooABM='
WHERE
key_id = '47882d0f8fd82d175739205fd9c5e1853afdb009b4680d3ac27ac6d47009adf8'
AND (
token = '/+TD2H5Z5kYu9zkOv2YPKhS1TygHB2dfA4+7EjooABM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)