UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's88o7rKcPdsiTNNqIsYTJG48547caYDeR0mamAoqH5I='
WHERE
key_id = 'ed68c4a762580e079768f6830981a20374a3149076f16040ccb4ac1ed695ad52'
AND (
token = 's88o7rKcPdsiTNNqIsYTJG48547caYDeR0mamAoqH5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)