UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KUV2ekr4MOnXBRaMDkGJCe3UgRTmVvBw6vHaWF0hL8I='
WHERE
key_id = '92b79d9b5ff369325cc3e6b488b478a253b71e2035e278da4d5ab44fcfcf1ab3'
AND (
token = 'KUV2ekr4MOnXBRaMDkGJCe3UgRTmVvBw6vHaWF0hL8I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)