UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3CNXjoOezIv5U29xol5c0qIhAdmfpRlgMvjFd2s602A='
WHERE
key_id = 'c900967602450919f7ccac903a6be1acb38ce811fe6c19354349a6fa37ac3874'
AND (
token = '3CNXjoOezIv5U29xol5c0qIhAdmfpRlgMvjFd2s602A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)