UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hCmDyotjF11vQvltO2fZh46Etk7s7B+zd2us+GuAvQ0='
WHERE
key_id = 'deece75ce86be301ec0f8237c8a7e9fc5b70623ce6b9ed75bb7217568d859673'
AND (
token = 'hCmDyotjF11vQvltO2fZh46Etk7s7B+zd2us+GuAvQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)