UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e+8tEjWZcLuM6Wng5xTUbD4EoGChglIzMp4fIOVz4mc='
WHERE
key_id = '5290a2b1e6568d747f6ae690a2e59efed728d394dccc860854500734942c4eab'
AND (
token = 'e+8tEjWZcLuM6Wng5xTUbD4EoGChglIzMp4fIOVz4mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)