UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QrjyOo77Ys1mMtXp8NX3ox2lzhiM7E0axVaIA4Z8MKc='
WHERE
key_id = 'ad3bec7ef16ca8f72f9471fb9ecf7c932b8db2bfc98100dde8f3ab61b4498da8'
AND (
token = 'QrjyOo77Ys1mMtXp8NX3ox2lzhiM7E0axVaIA4Z8MKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)