UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hnB3cZIvy27PT7oZ0FDYhPWGq2/z5rNDK2EM5xuAmAo='
WHERE
key_id = '2ad3a585e29cd621413e812dadac326c105a350289f91e4b4b78b6cdeaf46dff'
AND (
token = 'hnB3cZIvy27PT7oZ0FDYhPWGq2/z5rNDK2EM5xuAmAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)