UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wMFppOtkUtSuPzCA0+PsLXN1Il7lCzy4qG8vkBGbtKw='
WHERE
key_id = 'f4114a2b3afea6ab60db9a0df2365669dd1deb3bf0c55a1c255f28bf65bb6754'
AND (
token = 'wMFppOtkUtSuPzCA0+PsLXN1Il7lCzy4qG8vkBGbtKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)