UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WiA6+pD+YAjlB7bxW0Ad78jSeU9+nKrz37xvALQNJVQ='
WHERE
key_id = '4f71ef40615504fc219a68356102d6dc1fef67dee17c749d4a931a104a31a4c6'
AND (
token = 'WiA6+pD+YAjlB7bxW0Ad78jSeU9+nKrz37xvALQNJVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)