UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kc/2kQkGfXBmE8ysc0dLD9md/OvT3AkeTsq8aAb4euQ='
WHERE
key_id = 'de37170b3120f0b446f5ff90fc63a609204ddd3c532aab969c27409fd4cc7ca7'
AND (
token = 'Kc/2kQkGfXBmE8ysc0dLD9md/OvT3AkeTsq8aAb4euQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)