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