UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PqcuRiytRoJ6+rW6XkXSSsMIoLrCXOUE/K8DX46SC0='
WHERE
key_id = '830f7cf30bd1af11e99012785f0cdbef1ff323e58c54f36844bcc6e1db3fc4ec'
AND (
token = '2PqcuRiytRoJ6+rW6XkXSSsMIoLrCXOUE/K8DX46SC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)