UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M3Adqu4E6J7jOVjRK3KySwiVSRlp5R3TPzN5nPTsEW0='
WHERE
key_id = '6f54a5f8fca6b00367038c5ec447005fd9569e74947684149e3f9d181314bd53'
AND (
token = 'M3Adqu4E6J7jOVjRK3KySwiVSRlp5R3TPzN5nPTsEW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)