UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FiWaHwRZWHB1kiNDfDZIrJppxMzLMua2SYsYws4xcr4='
WHERE
key_id = '1065d8581af0324f271f6c66d15674a649964428319b329c82b77a1fbc4059f4'
AND (
token = 'FiWaHwRZWHB1kiNDfDZIrJppxMzLMua2SYsYws4xcr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)