UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+RkdWjLzRMgAsfBKCQDr3o75YOZYfl8ozNNciG1zDXk='
WHERE
key_id = '7bbdb4128a47ed259b15c544ee6b64466e7dfa05c7de7b02d9f25ee9338ec08a'
AND (
token = '+RkdWjLzRMgAsfBKCQDr3o75YOZYfl8ozNNciG1zDXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)