UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sYKqZMBI+pg0wzCubM7mXGQb6rL3iaKhShPx7xs/VUQ='
WHERE
key_id = '03829ac20b7d9edff94142ff5ea9e9377474782a4ea06b51f95e6ab9a1710260'
AND (
token = 'sYKqZMBI+pg0wzCubM7mXGQb6rL3iaKhShPx7xs/VUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)